home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / upc12bs1.zip / LIB / usrcatch.c < prev    next >
C/C++ Source or Header  |  1993-09-30  |  3KB  |  84 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       u s r c a t c h e r . c                                      */
  3. /*                                                                    */
  4. /*       Ctrl-Break handler for UUPC/extended                         */
  5. /*--------------------------------------------------------------------*/
  6.  
  7. /*--------------------------------------------------------------------*/
  8. /*       Changes Copyright (c) 1989-1993 by Kendra Electronic         */
  9. /*       Wonderworks.                                                 */
  10. /*                                                                    */
  11. /*       All rights reserved except those explicitly granted by       */
  12. /*       the UUPC/extended license agreement.                         */
  13. /*--------------------------------------------------------------------*/
  14.  
  15. /*--------------------------------------------------------------------*/
  16. /*                          RCS Information                           */
  17. /*--------------------------------------------------------------------*/
  18.  
  19. /*
  20.  *    $Id: usrcatch.c 1.3 1993/09/30 03:06:28 ahd Exp $
  21.  *
  22.  *    Revision history:
  23.  *    $Log: usrcatch.c $
  24.  * Revision 1.3  1993/09/30  03:06:28  ahd
  25.  * Use straight signal value as flag
  26.  *
  27.  * Revision 1.2  1993/09/29  13:18:06  ahd
  28.  * Drop unneeded OS/2 ifdef
  29.  *
  30.  * Revision 1.1  1993/09/29  04:49:20  ahd
  31.  * Initial revision
  32.  *
  33.  */
  34.  
  35. /*--------------------------------------------------------------------*/
  36. /*                        System include files                        */
  37. /*--------------------------------------------------------------------*/
  38.  
  39. #include <stdio.h>
  40. #include <signal.h>
  41. #include <process.h>
  42. #include <stdlib.h>
  43.  
  44. /*--------------------------------------------------------------------*/
  45. /*                    UUPC/extended include files                     */
  46. /*--------------------------------------------------------------------*/
  47.  
  48. #include "lib.h"
  49. #include "timestmp.h"
  50. #include "usrcatch.h"
  51.  
  52. /*--------------------------------------------------------------------*/
  53. /*                          Global variables                          */
  54. /*--------------------------------------------------------------------*/
  55.  
  56. extern unsigned long raised = 0;
  57.  
  58. /*--------------------------------------------------------------------*/
  59. /*    u s r 1 h a n d l e r                                           */
  60. /*                                                                    */
  61. /*    Handles SIGUSR interrupt; from MicroSoft Programmer's           */
  62. /*    Workbench QuickHelp samples                                     */
  63. /*--------------------------------------------------------------------*/
  64.  
  65. void
  66. #ifdef __TURBOC__
  67. __cdecl
  68. #endif
  69. usrhandler( int sig )
  70. {
  71.    raised = sig;
  72.  
  73.    if ( raised == 0 )
  74.       abort();
  75.  
  76. /*--------------------------------------------------------------------*/
  77. /*    The handler pointer must be reset to our handler since by       */
  78. /*    default it is reset to the system handler.                      */
  79. /*--------------------------------------------------------------------*/
  80.  
  81.    signal( sig , usrhandler );
  82.  
  83. } /* usrhandler */
  84.